import React from 'react';
import { Switch, Router, Redirect } from 'dva/router';
import routes from './config';
import { mapRouteMethod } from './util';

export default ({ history }) => {
  console.log('history', history)
  return (
    <Router history={history}>
        <Switch>
            {mapRouteMethod(routes)}
            <Redirect to="/" />
        </Switch>
    </Router>
  );
};
